package plus.exp;

import plus.B;
import plus.Gripe;
import plus.run.Emit;

public class E_Is extends Exp {
	private final Exp a, b;
	private final int lineNr;
	public E_Is(Exp a, Exp b, int lineNr) { this.a = a; this.b = b; this.lineNr = lineNr; }
	
	@Override
	public void threadScope() {
		a.threadScope();
		b.threadScope();
		Gripe.context = this;
		Gripe.lineNr = lineNr;
		a.unify_with(b);
		type = B._bool;
	}

	@Override String impliedName() { return null; }
	@Override String aThis() { return "an identity comparison"; }

	@Override
	public void compilePush() {
		a.compilePush();
		b.compilePush();
		Emit.compareIdentity();
	}

}
